#ifndef DRAGTREEWIDGET_H
#define DRAGTREEWIDGET_H
//
#include <QTreeWidget>

class AttributesModel;
//
class DragTreeWidget : public QTreeWidget
{
Q_OBJECT
	AttributesModel *_attributes;
	bool _accept_crd_on_toplevel;
protected:
	void dragEnterEvent ( QDragEnterEvent *event );
	void dragMoveEvent ( QDragMoveEvent *event );
	void dropEvent ( QDropEvent *event );
	void contextMenuEvent ( QContextMenuEvent * e );
	void keyPressEvent(QKeyEvent *e);
public:
	bool _menu_dominant;
	bool _show_dominant;
	DragTreeWidget(QWidget *p);
	void showMenuDominant(bool show=true);
	void showDominant(bool show=true);
	void setDominant(QTreeWidgetItem *item);
	void setAttributes(AttributesModel *attr);
	void setAcceptCrdOnTopLevel(bool ac=true);
private slots:
	void slotRemoveDomen();
	void slotEditItem();
	void slotDominant();
signals:
	void editItem(QTreeWidgetItem *item);
};
#endif
